<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/font-awesome.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/theme.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/carousel.css">
    <style>
        .nav-tabs > li.active > a, .nav-tabs > li.active > a:focus, .nav-tabs > li.active > a:hover {
            border-bottom-color: #ddd;
        }

        .nav-tabs > li > a {
            border-radius: 0;
        }

        span {
            display: none;
            color: #d43f3a;
        }

    </style>
</head>
<body>
<div class="navbar-wrapper">
    <%--动态导入另一个jsp页面，作用：将公共使用的部分提取出来，然后使用动态导入
          动态导入是不会导入include页面的编译指令的，而是仅仅将被导入页面的body内容插入本页面。--%>
    <jsp:include page="leader-header.jsp"></jsp:include>
</div>
<div class="container theme-showcase" role="main">

    <%--动态导入另一个jsp页面，作用：将公共使用的部分提取出来，然后使用动态导入
           动态导入是不会导入include页面的编译指令的，而是仅仅将被导入页面的body内容插入本页面。--%>
    <jsp:include page="leader-top.jsp"></jsp:include>
    <div class="container">
        <div class="row clearfix">
            <div class="col-md-8 column">
                <form id="upUser" name="form1" action="/tbQingjia/addQingJiaInfo" method="post"
                      class="form-horizontal" role="form">
                    <div class="form-group ">
                        <label>
                            标题 &nbsp;&nbsp;&nbsp;&nbsp;<span id="sp1">标题不能为空</span>
                        </label>
                        <input id="qingjiaTitle" name="qingjiaTitle" type="text" maxlength="255" value=""
                               class="form-control"
                               placeholder="请输入标题"/>
                    </div>
                    <div class="form-group ">
                        <label>
                            联系人&nbsp;&nbsp;&nbsp;&nbsp;<span id="sp2">联系人不能为空</span>
                        </label>
                        <input id="leaderName" name="leaderName" type="text" maxlength="50"
                               class="form-control form_datetime" value=""/>
                    </div>
                    <div class="form-group ">
                        <label>
                            联系电话&nbsp;&nbsp;&nbsp;&nbsp;<span id="sp3">联系电话不能为空</span>
                        </label>
                        <input id="leaderTel" name="leaderTel" type="text" maxlength="50"
                               class="form-control form_datetime" value="" placeholder="请输入联系电话"/>
                    </div>
                    <div class="form-group ">
                        <label>
                            请假时间&nbsp;&nbsp;&nbsp;&nbsp;<span id="sp4">请假时间不能为空</span>
                        </label>
                        <div class="row">
                            <div class="col-sm-5">
                                <input name="startTime" type="date" id="txtle_time1"
                                       class="form-control" placeholder=""/>
                            </div>
                            <div class="col-sm-1 text-center">
                                <p>到</p></div>
                            <div class="col-sm-5">
                                <input name="endTime" type="date" id="txtle_time2"
                                       class="form-control" placeholder=""/>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label>
                            请假理由&nbsp;&nbsp;&nbsp;&nbsp;<span id="sp5">请假理由不能为空</span>
                        </label>
                        <textarea name="qingjiaWhy" rows="5" cols="20" id="txtle_remark"
                                  class="form-control form_datetime" placeholder="理由不得少于10个字">
</textarea>
                    </div>
                    <div class="form-group " style="display: none">
                        <input id="leaderId" name="leaderId" readonly type="text" maxlength="50"
                               class="form-control form_datetime" value="${tbLeader.leaderId}"/>
                    </div>
                    <div class=" form-group">
                        <button id="tjQingJia" type="submit" name="btnSubmit" class="btn btn-primary">提交申请</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script src="${pageContext.request.contextPath}/resources/jquery/jquery-2.1.1.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/script/docs.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/script/back-to-top.js"></script>

</body>
<script>
    $(function () {

        $('input').focus(function () {
            $('input').css("border-color", "#CCC");
        });

        $('#tjQingJia').click(function panduan() {
            console.log($("#qingjiaTitle").val().length);
            if ($("#qingjiaTitle").val() == "") {
                $("#qingjiaTitle").css("border-color", "red");
                $('#sp1').show();
                return false;
            } else {
                $('#sp1').attr("display", 'none');
            }
            if ($("#leaderName").val() == "") {
                $("#leaderName").css("border-color", "red");
                $('#sp2').show();
                return false;
            } else {
                $('#sp2').attr("display", 'none');
            }
            if ($("#leaderTel").val() == "") {
                $("#leaderTel").css("border-color", "red");
                $('#sp3').show();
                return false;
            } else {
                $('#sp3').attr("display", 'none');
            }
            if ($("#startTime").val() == "") {
                $("#startTime").css("border-color", "red");
                $('#sp4').show();
                return false;
            } else {
                $('#sp4').attr("display", 'none');
            }
            if ($("#endTime").val() == "") {
                $("#endTime").css("border-color", "red");
                $('#sp4').show();
                return false;
            } else {
                $('#sp4').attr("display", 'none');
            }
            if ($("#qingjiaWhy").val() == "") {
                $("#qingjiaWhy").css("border-color", "red");
                $('#sp5').show();
                return false;
            } else {
                $('#sp5').attr("display", 'none');
            }
        })
    })
</script>
</html>
